Skip to content

Conversation

@kylecarbs
Copy link
Member

Problem

Ctrl+A (select all) and Ctrl+C (copy) were broken in text inputs because the keybinds were being intercepted globally, even when the user was typing.

Solution

Only intercept these keybinds when actively needed:

  • Ctrl+A (ACCEPT_EARLY_COMPACTION): Only intercept during active compaction, otherwise allow browser's select-all behavior
  • Ctrl+C (INTERRUPT_STREAM): Only intercept during compaction or when not in an editable element, otherwise allow browser's copy behavior

Testing

  1. Open cmux in browser (server mode)
  2. Type text in the chat input
  3. Press Ctrl+A - should select all text
  4. Press Ctrl+C - should copy selected text
  5. During active compaction, both keybinds should still trigger their compaction-related actions

Generated with cmux

Only intercept these keybinds when actively needed:
- Ctrl+A (ACCEPT_EARLY_COMPACTION): Only during active compaction
- Ctrl+C (INTERRUPT_STREAM): Only during compaction or when not in editable element

Fixes issue where Ctrl+A (select all) and Ctrl+C (copy) were broken
in text inputs due to premature event.preventDefault() calls.

These keybinds are meant for compaction control, not general input.
@kylecarbs kylecarbs added this pull request to the merge queue Oct 20, 2025
@kylecarbs kylecarbs removed this pull request from the merge queue due to a manual request Oct 20, 2025
@kylecarbs kylecarbs merged commit 88daab3 into main Oct 20, 2025
9 checks passed
@kylecarbs kylecarbs deleted the ctrl-all branch October 20, 2025 22:27
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant